<style type="text/css">
    p{ margin: 8px 0}
    .wrap{
        width: 100%;
        margin: 15px auto;
        padding: 20px 5px;
        background: white;
        border: 1px solid #DBDBDB;
        overflow: hidden;
        text-align: center;
    }
    .status{
        /*display: none;*/
        padding: 8px 35px 8px 14px;
        margin: 20px 0;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
        color: #468847;
        background-color: #dff0d8;
        border-color: #d6e9c6;
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px;
        border-radius: 4px;
    }
    input[type="submit"] {
        cursor:pointer;
        width:100%;
        border:none;
        background:#00a652;
        color:#FFF;
        font-weight: bold;
        margin: 20px 0;
        padding: 10px;
        border-radius:0px;
    }
    input[type="submit"]:hover {
        background:#424242;
    }
    input[type="submit"]:active {
        box-shadow:inset 0 1px 3px rgba(0,0,0,0.5);
    }
</style>

<div class="row">
    <div class="span12">
        <?php if ($this->Session->check('add_project')) { ?>
            <div class="span12 no-margin text-center">
                <h3 class="widget-title c-green">Add Project Process</h3>
                <ul>
                    <li class="c-green"><i class="icon-checkmark"></i> ขั้นตอนที่ 1 เพิ่มรายละเอียดโปรเจค</li>
                    <li class="icon-green"><i class="icon-checkmark"></i> ขั้นตอนที่ 2 เพิ่มและแก้ไขภาษา อื่น ๆ</li>
                    <li class=""><i class="icon-play"></i> ขั้นตอนที่ 3 เพิ่มรูปภาพ </li>
                </ul>
            </div>
        <?php } ?>

        <div class="span5 no-margin-left">
            <?php if (sizeof($images) != 0) { ?>
                <h4>Images</h4>
                <?php foreach ($images as $a): ?>
                    <div class="span6 border-bottom no-margin padding10 text-center">
                        <?php echo $this->Html->image($a['Image']['path'], array('width' => '100%')); ?>
                        <div class="span12">
                            <?php echo $this->Html->link('Set To Default', '/Projects/updatePath/' . $a['Image']['id'].'/'.$data['Project']['id'], array('escape' => false, 'title' => 'View Details')) ?> 
                            &nbsp;/&nbsp;
                            <?php echo $this->Html->link('Delete', '/Images/delete/' . $a['Image']['id'] . '/' . $data['Project']['id'], array('escape' => false, 'title' => 'Delete'), 'Do you want to remove this image?') ?> 

                        </div>
                    </div>
                <?php endforeach; ?>
            <?php } else { ?> 
                <h5 class="c-red text-center">Not have image,Please upload.</h5>
            <?php } ?>

            <div class="wrap">
                <?php
                # error messages
                if (isset($message)) {
                    foreach ($message as $msg) {
                        printf("<p class='status'>%s</p></ br>\n", $msg);
                    }
                }
                # success message
                if (isset($count) && $count != 0) {
                    printf("<p class='status'>%d files added successfully!</p>\n", $count);
                }
                ?>
                <!-- Multiple file upload html form-->
                <?php echo $this->Form->create('Project', array('type' => 'file', 'id' => 'upload', 'enctype' => 'multipart/form-data')); ?>
                <input type="file" name="files[]" multiple="multiple" accept="image/*">
                <input type="submit" value="Upload">
                <p>ขนาดของแต่ละไฟล์ ต้องไม่เกิน 500KB</p>
                <p>ประเภทของไฟล์ต้องเป็น jpg, png, gif เท่านั้น</p>
            </div>
        </div>
        <div class="span7">            
            <h4><?php echo h($data['ProjectDetail'][0]['title']) ?></h4>
            <?php echo $this->Html->image($data['Project']['default_pic'], array('width' => '70%')); ?>
            <table>
                <tr>
                    <td width="200px">Property Type</td>
                    <td><?php echo h($data['PropertyType']['name_eng']) ?></td>
                </tr>
                <tr>
                    <td>Project Code</td>
                    <td><?php echo h($data['Project']['code']) ?></td>
                </tr>            
                <tr>
                    <td>Price Start</td>
                    <td><?php echo h($data['ProjectDetail'][0]['price']) ?></td>
                </tr>
                <tr>
                    <td>Create Date</td>
                    <td><?php echo h($data['Project']['created']) ?></td>
                </tr>
                <tr>
                    <td>Create By</td>
                    <td><?php echo h($data['Project']['create_by']) ?></td>
                </tr>
                <tr>
                    <td>Location</td>
                    <td><?php echo h($data['Amphur']['name_eng'] . ', ' . $data['Amphur']['Province']['name_eng']) ?></td>
                </tr>
                <tr>
                    <td>Address</td>
                    <td><?php echo h($data['ProjectDetail'][0]['address']) ?></td>
                </tr>
            </table>
        </div>
    </div>
</div>